﻿using Demo.Framework.Business.Debug;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Demo.Framework
{
    public class Renderer
    {
        private readonly GraphicsDevice _graphicsDevice;
        private readonly Blur _blur;

        public Renderer(GraphicsDevice graphicsDevice)
        {
            _graphicsDevice = graphicsDevice;
            _blur = new Blur(_graphicsDevice);
            _blur.SetBlurPower(230);
        }

        public delegate void SimpleDrawDelegate(GameTime gameTime);

        public void DrawWithBlur(SimpleDrawDelegate drawDelegate, GameTime time)
        {
            _blur.BeginBlur();
            drawDelegate(time);
            _blur.EndBlur();
        }
    }
}
